<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue的组件开发</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h1>{{message}}</h1>
        <login></login>
        <user-list></user-list>
    </div>
</body>
</html>
<script>
    Vue.component('login',{
        template: `
                    <div>
                        <h1>用户登录</h1>
                        <div>
                            <input type="text" placeholder="用户名"/>
                        </div>
                        <div>
                            <input type="password" placeholder="密码"/>
                        </div>
                        <div>
                            <button>登录</button>
                        </div>
                   </div>`,
    });
    // 创建全局的用户列表组件
    Vue.component('userList',{
        template: `
                    <div>
                        <h1>用户列表</h1>
                   </div>`,

    })
    var app = new Vue({
        el: '#app',
        data: {
            message: 'vue的组件开发'
        },
    })
</script>